package com.nts.bupna.errors;

import org.antlr.runtime.RecognitionException;

public abstract class RecognitionError extends BaseError {

    private final RecognitionException recognitionException;

    public RecognitionError(final String header, final String message, final RecognitionException recognitionException) {
        super(createMessage(header, message, recognitionException));
        this.recognitionException = recognitionException;
    }

    public RecognitionException getRecognitionException() {
        return recognitionException;
    }

    private static String createMessage(final String header, final String message, final RecognitionException e) {
        return header + " " + message + ", caused by " + e;
    }
}
